﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using com.vs.DataAccess;
using com.vs.DataAccess.DO;
using com.vs.General;
using com.vs.General.RF;

namespace com.vs.RF.Web.receiving
{
    public partial class ItemEntry : RFDisplayPage
    {
        protected DataTable dtRcpDtl = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            go();
        }

        protected override void parseRequest()
        {
            this.stErrorMessage = Request[RFSupport.ERROR_MESSAGE];
        }

        protected override void initData()
        {
            DataHelper helper = null;

            try
            {
                Session.Remove(RFSupport.INTERNAL_RECEIPT_LINE_NUM);
                Session.Remove(RFSupport.ITEM_DO);

                helper = new DataHelper(this.rfSess);
                dtRcpDtl = helper.GetTable(CommandType.StoredProcedure, 
                    "RCP_RReceiptDetailWithOpenQty", 
                    new IDataParameter[]{
                        DataHelper.BuildParameter(rfSess, "@INTERNAL_RECEIPT_NUM", (int)Session[RFSupport.INTERNAL_RECEIPT_NUM])
                    });
            }
            catch (Exception e)
            {
                ExceptionManager.LogException(rfSess, e);
                stErrorMessage = e.Message;
            }
            finally
            {
                if (helper != null)
                    helper.Dispose();
            }
        }
    }
}
